package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119603682";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQClinf794DiTJiKnJBpu8MqJMRcDA+pv7RWfzg5IAuJt0j7XnwaOgY6LTHY4BXxHqHJIE+4YpSgrcjnvP4OHGWCYSajf1/zLc/sntxkLw6U4A4BorFAnJVClgU/P94k5ugT/DZnxgBnHyY+nexvEE9UdyKOhgs70aV06SWgLKo29r7OjAjq/MeWLcf1/fU2jMFWQjm7YdmFUa6wINXW5tswLFy1EZQlAju0u6kDWNTy7wyisADDkKCAMY1VVF4SDJO49Rd1hogYl+39y56LRshXXEkN/eRovCQvOYo1djk+wig+Pa/g78C3ARr3c9Vt1wVDeyBUK5T+TODqQu2JdSOVAgMBAAECggEBAJdOCb7eiQnOUrqWwZQyzv5tHqC3UXWox+8rVrs34/Pa97TxtmLOWDTCbEY7AzMg+WT4yITSbeCzFudhIaDKKanSnFtiJ9QAMoSm6vAS5rQCWir6hiJ1PCPhNSiLesKl3sethhixrFqU6QLgm2MkOC4OuiIkuI3TX/SMyRwu1uFmg2g2Tb615iOxcS2VWwSYq7UrQ9pZieammUhSZBS/yyjHKRhKTn7YzsJDQOthu57lUAC+VOH9qghJbHL1C5B5epyanC+96LCC1aYqpdjzwooou8mf3RcPeGwHKIl/XaFPexD8xETEmchYsweD4UwWycDfG5b/QC4Dn4j/2eu98p0CgYEA/in9p/gNgkdgcWuPJfVgkCQ5BXIrOj036p6++ouLGhaibNnuhUGATCKJWp5fVd5eKxSsd+4mHQ3qiLf7KXqRfma9nbRv54t9imWvmBTCMsieoUaNZadIuYkbEdM9XNtZMp1ZnKk2gtupfzqnWqMuGSbhLyOXBvHZuvf1nH8J8vcCgYEApryXwWO+yCHiAZ0CKAHQ6sUALZUJN5ZtXmAHUyD7ExsPE53WWIhi5cIhZyQMvJba1GQ2DSwX4YqDADPZgA8grCLUKfDpL+gw3SSbUEjb8yGIiZ4utOzlI1+8qNYXcbNajAF8eHJrXiutccKXC9Dt1RllikUGxO0jGWEMrDJSrtMCgYEArGaDPnpNf3829fhFgzPsKhnH69/DXp/D3AuN85jP5ARSbI9u8Ui64+nRTXx7ol1RdttxGXCavb6Axfg2D66qHhlGqUCJX4AIyeWrs/bwu03F/BNFOhy8gc10ZSTqTKAk4uZEsLU+2ohxcnGwrxRc4oay3CzB9t36GI61NVAeyYUCgYA6nB6IF0TP2sE0KfnBEGpcrCUU4Medp54IR58rhHNdUuyoy5m2AzMoamYNeGmVvT1s3VD2rmIyoNrNrmwtDKRCffewSoPdmDPc+Goz/Xh7bXUuUtE+PeuJ1LRfcOpKyG3yuu8C8810C8xrKaiouadwef3sbbkkbeshl7C5svLHiwKBgCVudgjSk4lv6ZIv80PRDrTHybByTFHLOPFs3IcYLm237JXpjQVA2FstAmw9FtpLdzpw5EVOoFkz+7KcRtMkPbsLnwUGOfWyltaWoF6rlyaeQarCRKGUOSDhnSRs/1QbyVnafbIh8KkzCr++FGDGcgPMb/39fOszaEjJG0UyYeWm";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArlo9Qiy+f3Qm9QjXOGRJSjPPnP1Aufje7nUh0mrXeUMkoQtqqnxKKyI0XQiVNds8XG8VgtMcVq8QQcNFEk359kVAwmUWl72jAAaQ/dhGFuYkkYrmisEN2tb+TzCOyqwbvLZgSxCqd5u43oD7f00NfZR9k22LsLvfCDxhX7whssR+6nWk482+9vwUMUATugs3s8PXEeCXafqV/Adng9Yclp3vo1Y8an5zhoL65lX6w9Wfq59vW0YxiGMjB0Og7TME+9VofLTWx8A5IlAxCIKOFxMqhfpdCh2Ok2oB0sAKEroeKIKxsQFJNxbabH4U4rDQPmN6M6f1XYUpZoFwGXKykwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://c48119006f.qicp.vip/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://c48119006f.qicp.vip/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关 默认是生产环境 我们需要的是测试环境
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

